package com.ruoyi.match.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.match.mapper.MatchAttachmentsMapper;
import com.ruoyi.match.domain.MatchAttachments;
import com.ruoyi.match.service.IMatchAttachmentsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 附件Service业务层处理
 * 
 * @author 星野漫游
 * @date 2024-06-02
 */
@Service
public class MatchAttachmentsServiceImpl implements IMatchAttachmentsService 
{
    @Autowired
    private MatchAttachmentsMapper matchAttachmentsMapper;

    /**
     * 查询附件
     * 
     * @param attachmentId 附件主键
     * @return 附件
     */
    @Override
    public MatchAttachments selectMatchAttachmentsByAttachmentId(Long attachmentId)
    {
        return matchAttachmentsMapper.selectMatchAttachmentsByAttachmentId(attachmentId);
    }

    /**
     * 查询附件列表
     * 
     * @param matchAttachments 附件
     * @return 附件
     */
    @Override
    public List<MatchAttachments> selectMatchAttachmentsList(MatchAttachments matchAttachments)
    {
        return matchAttachmentsMapper.selectMatchAttachmentsList(matchAttachments);
    }

    /**
     * 新增附件
     * 
     * @param matchAttachments 附件
     * @return 结果
     */
    @Override
    public int insertMatchAttachments(MatchAttachments matchAttachments)
    {
        return matchAttachmentsMapper.insertMatchAttachments(matchAttachments);
    }

    /**
     * 修改附件
     * 
     * @param matchAttachments 附件
     * @return 结果
     */
    @Override
    public int updateMatchAttachments(MatchAttachments matchAttachments)
    {
        return matchAttachmentsMapper.updateMatchAttachments(matchAttachments);
    }

    /**
     * 批量删除附件
     * 
     * @param attachmentIds 需要删除的附件主键
     * @return 结果
     */
    @Override
    public int deleteMatchAttachmentsByAttachmentIds(String attachmentIds)
    {
        return matchAttachmentsMapper.deleteMatchAttachmentsByAttachmentIds(Convert.toStrArray(attachmentIds));
    }

    /**
     * 删除附件信息
     * 
     * @param attachmentId 附件主键
     * @return 结果
     */
    @Override
    public int deleteMatchAttachmentsByAttachmentId(Long attachmentId)
    {
        return matchAttachmentsMapper.deleteMatchAttachmentsByAttachmentId(attachmentId);
    }
}
